import 'package:flutter/material.dart';

class chatListView extends StatelessWidget {
  String localImageUrl = 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1541152187667&di=c5da3dfaf55512503ce905b468667592&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fitem%2F201412%2F09%2F20141209231227_2sFWx.thumb.700_0.jpeg';
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        _buileListItem('', '熊家大院','妈咪一帆风顺:[视频]','昨天'),
        _buileListItem('', '你','[图片]','10月27日'),
        _buileListItem('', '亲亲的家','妈咪一帆风顺:[视频]','10月27日'),
        _buileListItem('', '公园1号楼栋管家-周庄莉','好的今天是个后按积分看电视剧了房间里就','10月18日'),
        _buileListItem('', '修车师傅','修车师傅领取了你的红包','9月18日'),
        _buileListItem('', '音艺咖','曹洪波:','8月12日'),
        _buileListItem('', '范益工长','[Photo]','8月12日'),
        _buileListItem('', '公园一号7栋装修。、V！！','[Photo]','8月12日'),
      ],
    );
  }

  Widget _buileListItem(String imgUrl, String title, String content, String time){
    return Container(
      decoration: BoxDecoration(
        // color: Colors.pink,
        border: Border(
          bottom: BorderSide( color: Colors.black12, width: 1),  
        ),
      ),
      padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
      // margin: const EdgeInsets.only( bottom: 20.0),
      child:  Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          Container(
            alignment: Alignment.center,
            // padding: const EdgeInsets.all(10.0),
            color: Colors.red, 
            child: Image.network(localImageUrl, width: 60.0,height: 60.0,),
          ),
          Expanded(
            flex: 1,
            child: Container(
              // color: Colors.red,
              padding: const EdgeInsets.only( left: 10.0),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Container(
                    padding: const EdgeInsets.only( bottom: 10.0),
                    // color: Colors.black,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Text(title, style: TextStyle( fontSize: 15.0,color: Colors.black),),
                        Text(time, style: TextStyle(fontSize: 13.0,color: Colors.black26),),
                      ],  
                    ), 
                  ),
                  Text(content, style: TextStyle(fontSize: 14.0 ,color: Colors.black26),maxLines: 1,),
                ], 
              )
            ), 
          ),
        ], 
      ), 
    );
  }
  Widget _builderHeader(int msgCount, bool showMsgCount){
    return Container(
      // child: , 
    );
  }

}